package com.example.webdemo.bean;

import cn.hutool.core.util.RandomUtil;
import lombok.Data;

import javax.validation.constraints.NotBlank;

/**
 * @author zp
 * @version 1.0
 * @description: 测试模型 user
 * @date 2023/6/25 18:46
 */
@Data
public class User {
    private String userName;
    private String name;
    @NotBlank(message = "数据号码不能为空")
    private String phone;
    @NotBlank(message = "验证码不能为空")
    private String code;
    private String sex;
    private int age;
    private String photo;
    private int artCount;
    private int followCount;
    private int fansCount;

    public static User builder(){
        User user = new User();
        user.setPhoto("https://randomuser.me/api/portraits/men/97.jpg");
        user.setUserName("John Doe");
        user.setArtCount(RandomUtil.randomInt(100));
        user.setFollowCount(RandomUtil.randomInt(100));
        user.setFansCount(RandomUtil.randomInt(100));
        return user;
    }
}
